﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Sinacor.Infra.Core.Licensing
{
    [Serializable]
    public class Module
    {
		int _id;
		string _name;
		string _monogram;
		DateTime _goodThru;
		bool _plus;
		bool _isSelected;

		public int ID
		{
			get { return _id; }
			set { _id = value; }
		}
		public string Name
		{
			get { return _name; }
			set { _name = value; }
		}
		public string Monogram
		{
			get { return _monogram; }
			set { _monogram = value; }
		}
		public DateTime GoodThru
		{
			get { return _goodThru; }
			set { _goodThru = value; }
		}
		public string ExpirationDate
		{
			get
			{
				if (_goodThru > DateTime.MinValue)
					return _goodThru.ToString("dd/MM/yyyy");
				else
					return "";
			}
		}
		public bool Plus
		{
			get { return _plus; }
			set { _plus = value; }
		}
		public bool IsSelected
		{
			get { return _isSelected; }
			set { _isSelected = value; }
		}		

        public Module()
        {
        }

        public Module(string name, string monogram, bool plus)
        {
            this.Name = name;
            this.Monogram = monogram;
            this.Plus = plus;
        }

        public Module(string name, string monogram, bool plus, DateTime goodthru)
        {
            this.Name = name;
            this.Monogram = monogram;
            this.Plus = plus;
            this.GoodThru = goodthru;
        }
    }
}